﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Money
{
    [Serializable]
    public class KeyboardShortcut
    {
        public bool Shift { get; set; }
        public bool Ctrl { get; set; }
        public bool Alt { get; set; }
        public Keys KeyCode { get; set; }

        public string Name { get { return ToString(); } }

        public override string ToString()
        {
            string text = "";

            if (Shift)
            {
                text += "SHIFT + ";
            }
            if (Ctrl)
            {
                text += "CTRL + ";
            }
            if (Alt)
            {
                text += "ALT + ";
            }

            text += KeyCode.ToString();

            return text;
        }

        public bool Equals(KeyboardShortcut shortcut)
        {
            if (shortcut == null)
            {
                return false;
            }

            if (this == shortcut)
            {
                return true;
            }

            if (Alt == shortcut.Alt && Ctrl == shortcut.Ctrl && Shift == shortcut.Shift && KeyCode == shortcut.KeyCode)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}
